package com.supermarket.manage.provider.api.outstock;

import com.supermarket.manage.common.dto.PageBean;
import com.supermarket.manage.common.dto.home.request.HomeInitParams;
import com.supermarket.manage.common.dto.home.response.ProfitDataDto;
import com.supermarket.manage.common.dto.home.response.TopDto;
import com.supermarket.manage.common.dto.home.response.TrendDto;
import com.supermarket.manage.common.dto.stock.request.OutstockPageParams;
import com.supermarket.manage.common.dto.stock.response.OutstockDto;
import com.supermarket.manage.common.pojo.Outstock;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-03-16 19:28
 **/
public interface OutstockService {
    /**
     * 分页条件查询出库单列表
     *
     * @param params
     * @return
     */
    PageBean<Outstock> getOutstockPageList(OutstockPageParams params);

    /**
     * 根据id获取出库单详情
     *
     * @param id
     * @return
     */
    OutstockDto getOutstockById(String id);

    /**
     * 根据id完成出库单
     *
     * @param outstock
     * @return
     */
    Boolean doneOutstockById(Outstock outstock);

    /**
     * 根据id删除出库单
     *
     * @param id
     * @return
     */
    Boolean deleteOutstockById(String id);

    /**
     * 添加出库单
     *
     * @param outstock
     * @return
     */
    Boolean addOutstock(Outstock outstock);

    /**
     * 更新出库单
     *
     * @param outstock
     * @return
     */
    Boolean updateOutstock(Outstock outstock);

    /**
     * 添加出库单并减少商品库存
     *
     * @param outstock
     * @return
     */
    Boolean addOutstockAndUpdateStockingNumber(Outstock outstock);

    /**
     * 更新出库单并减少商品库存
     *
     * @param outstock
     * @return
     */
    Boolean updateOutstockAndUpdateStockingNumber(Outstock outstock);

    /**
     * 获取出库相关盈利金额（销售，采购退货）
     *
     * @param params
     * @return
     */
    ProfitDataDto getSales(HomeInitParams params);

    /**
     * 获取销售趋势
     *
     * @param params
     * @return
     */
    List<TrendDto> getSalesTrend(HomeInitParams params);

    /**
     * 根据出库单id获取会员信息
     *
     * @param id
     * @return
     */
    Outstock getMemberByOutStockId(String id);

    /**
     * 根据购买额度排名会员
     *
     * @param params
     * @return
     */
    List<TopDto<String>> getTopMember(HomeInitParams params);

    /**
     * 获取出库单列表
     *
     * @param params
     * @return
     */
    List<Outstock> getOutstockList(OutstockPageParams params);
}
